package io;

import org.junit.Test;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

public class Write {
    @Test
    public void test() throws IOException {
        FileOutputStream file = new FileOutputStream("write.txt");
        String str="你好你吃了吗";
        byte[] bs=str.getBytes();//utf -8 1字符3字节
        //写入 好 字 off从自己人数组中那个数组开始
        file.write(bs,3,3);
        System.out.println(Arrays.toString(bs));

    }
}
